import React from 'react';
import { Text, View } from 'react-native';
import Icon from 'react-native-vector-icons/Feather';
import styles from './style'

const SIZE = 64;

export default ({ title = 'title', msg = 'msg', type = 'success', children }) => {
  const icon = (type) => {
    switch (type) {
      case 'success': {
        return <Icon name="check-circle" color="#1F90E6" size={SIZE} />;
      }
      case 'warning': {
        return <Icon name="check-circle" color="#1F90E6" size={SIZE} />;
      }
      case 'waiting': {
        return <Icon name="check-circle" color="#1F90E6" size={SIZE} />;
      }
      case 'info': {
        return <Icon name="check-circle" color="#1F90E6" size={SIZE} />;
      }
      default: {
        return <Icon name="check-circle" color="#1F90E6" size={SIZE} />;
      }
    }
  }
  return (
    <View style={styles.wrap}>
      <View style={styles.iconWrap}>
        <View style={styles.icon}>{icon(type)}</View>
      </View>
      <Text style={styles.title}>{title}</Text>
      <Text style={styles.msg}>{msg}</Text>
      <View style={styles.cont}>
        {children}
      </View>
    </View>
  );
};
